<?php
include "includes/comunes.php";
if (!function_exists('json_encode')) {
	require_once 'json/jsonwrapper_inner.php';
}



$array = array();
if ($_GET['_name'] == 'financiera')
{

	 if ( $_GET['_value'] == 0 )//usa
	 {
		$array[] = array('0' => 'Sin valores');
		
	  } else
	  {
              $sqlplanes="select * from planes where financiera=".$_GET['_value'];
              $respla=cons_ins($sqlplanes);
              while ($reg=mysql_fetch_array($respla)){
              $array[] = array($reg['id'] => utf8_encode($reg['nombre']));
          
              }

	  }
} elseif ($_GET['_name'] == 'plan')
{
	 if ( $_GET['_value'] == 0 )//New York
	 {
		$array[] = array('0' => 'Sin valores');
	  } else
	  {
              $sqlplanes="select * from planes where id=".$_GET['_value'];
              $respla=cons_ins($sqlplanes);
              while ($reg=mysql_fetch_array($respla)){
              $array[] = array($reg['id']."_".$reg['cuotas']."_".$reg['gracia']."_".$reg['descuenta'] => utf8_encode($reg['tasa']));
             
              }
	}
} else
{
	$array[] = array('1' => 'Data 1');
	$array[] = array('2' => 'Data 2');	
	$array[] = array('3' => 'Data 3');	
}
echo json_encode( $array );
?>
